From 458dbeddf3a3ca20ebe5c1404b79dd6101c9a67d Mon Sep 17 00:00:00 2001 From: "emellor@leeni.uk.xensource.com" Date: Thu, 8 Dec 2005 15:54:35 +0000 Subject: [PATCH] Fix ip_of to cope with interfaces with multiple addresses, courtesy of Adam Heath . Signed-off-by: Ewan Mellor --- tools/examples/vif-common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/examples/vif-common.sh b/tools/examples/vif-common.sh index 18a0b6c88e..105a843900 100644 --- a/tools/examples/vif-common.sh +++ b/tools/examples/vif-common.sh @@ -113,7 +113,7 @@ function handle_iptable() # function ip_of() { - ip addr show "$1" | sed -n 's/^.*inet \([0-9.]*\).*$/\1/p' + ip addr show "$1" | awk "/^.*inet.*$1\$/{print \$2}" | sed 's,/.*,,' } -- 2.30.2